<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <meta charset="utf-8" />
    <script src="js/jquery-1.3.1.js" type="text/javascript"></script>
    <style type="text/css">
        .style1 {
            width: 100%;
        }
		.style1 td{
			border: 1px solid orange;
		}
    </style>
	<script type="text/javascript">
		$(function(){
			
			
			$(".style1>tbody>tr:odd").css("background-color", "#abf3e4");
			$(".style1>tbody>tr:even").css("background-color",  "#46e7bf");
			
			//光棒效果
			//方法1
			//var col="";
			//$(".style1>tbody>tr").mouseover(function()
			//{
			//	col=$(this).css("background-color");
			//	$(this).css("background-color","aqua");
			//}).mouseout(function()
			//{
			//	//$(".style1>tbody>tr:odd").css("background-color", "#abf3e4");
			//	//$(".style1>tbody>tr:even").css("background-color",  "#46e7bf");
			//	$(this).css("background-color",col);
			//});
			
			//方法2
			$(".style1>tbody>tr").mouseover(function()
			{
				var col=$(this).css("background-color")
				$(this).attr("bg",col);
				$(this).css("background-color","aqua");
			}).mouseout(function()
			{
				$(this).css("background-color",$(this).attr("bg"));
				$(this).removeAttr("bg");
			});
			
			//全选
			var qx="";
			$("#chkAll").change(function()
			{
				//qx=this.checked;
				//$(".style1 :checkbox").each(function()
				//{
				//	this.checked=ck;
				//});
				qx=$(this).attr("checked")
				$("input:[name='chkItem']").attr("checked",ck)
			});
			
			//返选
			$("#chkRev").change(function()
			{
				//$(".style1 :checkbox").each(function()
				//{
				//	this.checked=!this.checked;
				//});
				$("input:[name='chkItem']").each(function()
				{
					var fx=$(this).attr("checked");
					$(this).attr("checked",!fx)
				});
			});
			
			
		});
	</script>
</head>
<body>
    <!--<div>
        <select id="Select1" multiple="multiple">
            <option>张三</option>
            <option>李四</option>
            <option>王五</option>
            <option>越六</option>
        </select>
    </div>
    <div>
        <select id="Select2" multiple="multiple">
            <option>钱七</option>
        </select>
    </div>-->
    <div style="background-color:Green"></div>
    <div>
        <input id="chkAll" type="checkbox" />全选
        <input id="chkRev" type="checkbox" />返选
    </div>
    <div>

        <table id="tb" class="style1">
            <tbody>
                <tr>
                    <td>
                        <input name="chkItem" type="checkbox" />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        <input name="chkItem" type="checkbox" />
                    </td>
                    <td>
                        b
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        <input name="chkItem" type="checkbox" />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        c
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        <input name="chkItem" type="checkbox" />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        d
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        <input name="chkItem" type="checkbox" />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        e
                    </td>
                </tr>
                <tr>
                    <td>
                        <input name="chkItem" type="checkbox" />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        f
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        <input name="chkItem" type="checkbox" />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        g
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        <input name="chkItem" type="checkbox" />
                    </td>
                    <td>
                        h
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        <input name="chkItem" type="checkbox" />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        <input name="chkItem" type="checkbox" />
                    </td>
                    <td>
                        j
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</body>
</html>
